#include <iostream>
#include <vector>
using namespace std;

int GCD(int a,int b)
{
    //辗转相除法
    int c;
    while(c=a%b)
    {
        a = b;
        b = c;
    }
    return b;
}

int getPower(int n,int a)
{
    vector<int> num(n);
    for(int i = 0;i < n;i++) //输入敌人的防御值
    {
        cin >> num[i];
    }

    for(int i = 0;i < n;i++)
    {
        if(a >= num[i])
            a += num[i];
        else
            a += GCD(a,num[i]);
    }
    return a;
}



int main()
{
    int n,a;
    int power;
    while(cin >> n >> a)
    {
        power = getPower(n,a);
        cout << power << endl;
    }
    return 0;
}
